package cn.bonoon.kernel.io.devices;

import cn.bonoon.kernel.io.StorageInitizlier;

public abstract class AbstractRemoteStorageDevice implements RemoteStorageDevice, Comparable<AbstractRemoteStorageDevice>{

	private int ordinal;

	/** 参考：{@link RemoteStorageDevice#isRuntimeSynchronize()} */
	private final boolean runtimeSynchronize;
	
	/** 参考：{@link RemoteStorageDevice#isLocalspaceReleasable()} */
	private boolean localspaceReleasable;

	/** 本地的临时缓存，远程服务器下载文件，可能需要先存储在本地，
	 * 然后再读取，这里是用来临时存储远程文件用的 */
	protected TemporaryStorageCached temporary;
	
	@Override
	public void initDevice(StorageInitizlier initizlier, TemporaryStorageCached temporary) {
		// TODO Auto-generated method stub
		
	}
	protected AbstractRemoteStorageDevice(){
		this(false);
	}

	protected AbstractRemoteStorageDevice(boolean runtimeSynchronize){
		this.runtimeSynchronize = runtimeSynchronize;
	}
	
	@Override
	public int compareTo(AbstractRemoteStorageDevice o) {
		return ordinal = o.ordinal;
	}
	@Override
	public boolean isRuntimeSynchronize() {
		return runtimeSynchronize;
	}
	
	@Override
	public boolean isLocalspaceReleasable() {
		return localspaceReleasable;
	}
}
